package org.bzjj.timer;

import java.util.Date;

import org.apache.log4j.Logger;
import org.bzjj.log.MyLog;
import org.bzjj.servlet.update.JkIpUpdate;
import org.bzjj.tool.Tools;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component // import org.springframework.stereotype.Component;
public class JkJob {
	@Scheduled(cron = "0 20 18 * * ?") // 每天18:20执行一次
	public void myTest() {
		Logger logger = MyLog.getLog("JkJob");
		if (Tools.getProPerty().getProperty("jkupdate").equals("1")) {
			logger.info("开始执行接口IP修改定时任务,任务执行时间:" + new Date());
			JkIpUpdate.ipUpdate();
		} else if (Tools.getProPerty().getProperty("jkupdate").equals("0")) {
			logger.info("开始执行接口IP修改定时任务,任务未配置运行。");
		}
	}
}